package com.juren.student.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.juren.eap.student.Student;
import com.juren.eap.student.service.IStudentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Title: 学生信息
 * @Description: 操作学生信息的web端
 * @Author: zt
 * @Date: 2019/1/14  17:46
 * @Version:
 */
@Api(value = "学生信息controller", tags = {"学生信息操作接口"})
@RestController
@Slf4j
public class StudentController {

    @Reference
    private IStudentService studentService;

    @ApiOperation(value = "获取学生信息", notes = "学生的id必须提供,用户名可不提供")
    @GetMapping("/getUserInfo")
    public Student getUserInfo(@ApiParam(name = "id", value = "学生id", required = true)String id, @ApiParam(name = "username", value = "学生名") String studentName) {
        Student student = studentService.getStudentInfo(id, studentName);
        log.info(student.toString());
        return student;
    }
}

